package com.wjh.kt_order.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wjh.kt_order.service.OrderInfoService;
import com.wjh.kt_vod.model.order.OrderInfo;
import com.wjh.kt_vod.result.Result;
import com.wjh.kt_vod.vo.order.OrderInfoQueryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * Wang_Junhong
 * 2022/7/16
 * 文件描述：
 */

@Api(tags = "订单管理")
@RestController
@RequestMapping("/admin/order/orderInfo")
public class OrderInfoController {

    @Autowired
    private OrderInfoService orderInfoService;

    @ApiOperation(value = "订单查询")
    @GetMapping("/{page}/{limit}")
    public Result listOrder(@PathVariable("page") @ApiParam(name = "page",value = "当前页",required = true) Long page
            , @PathVariable("limit")  @ApiParam(name = "limit",value = "每页记录数",required = true) Long limit
            , OrderInfoQueryVo orderInfoQueryVo) {
        Page<OrderInfo> orderInfoPage = new Page<>(page, limit);
        Map<String, Object> map = orderInfoService.selectOrderInfoPage(orderInfoPage, orderInfoQueryVo);
        return Result.ok(map);
    }

}
